export default {
	// 1、必须先指定命名空间：
	namespaced: true,
	// 2、通过state来声明变量数据：
	state: () => {
		return {
			appInfo: uni.getStorageSync('appInfo'),
			appConfig: uni.getStorageSync('appConfig'),
			appData: uni.getStorageSync('appData')
		}
	},
	mutations: {
		setAppConfigMethod(state, value) {
			// console.log(value,'value==============');
			uni.setStorageSync('appConfig', value)
		},
		setAppDataMethod(state, value) {
			// console.log(value,'value==============');
			uni.setStorageSync('appData', value)
		},
		setAppInfoMethod(state, value) {
			uni.setStorageSync('appInfo', value)
		},
		removeAppConfigMethod(state, val) {
			uni.removeStorageSync('appConfig')
		},
		removeAppInfoMethod(state, val) {
			uni.removeStorageSync('appInfo')
		},
		removeAppDataMethod(state, val) {
			uni.removeStorageSync('appData')
		}
	},
	actions: {
		getAppConfigMethod(state) {
			return uni.getStorageSync('appConfig')
		},
		getAppInfoMethod(state) {
			return uni.getStorageSync('appInfo')
		},
		getAppDataMethod(state) {
			return uni.getStorageSync('appData')
		}
	}
}